import { PageReq, PageRes } from '@/api/types'
import request from '@/utils/request'
import { InStoreModel } from '@/api/model/asset-management/asset-in-store-model'

// 获取入库列表
export function inStorePageApi(data: PageReq<Partial<any>>) {
  return request<PageRes<any>>({
    url: '/inStore/page',
    method: 'post',
    data
  })
}

// 新增入库
export function addInStoreApi(data: Partial<InStoreModel>) {
  return request({
    url: '/inStore/add',
    method: 'post',
    data
  })
}

// 更新入库
export function editInStoreApi(data: Partial<InStoreModel & { id: number }>) {
  return request({
    url: '/inStore/edit',
    method: 'post',
    data
  })
}

// 删除入库
export function delInStoreApi(data: { id: number }) {
  return request({
    url: '/inStore/del',
    method: 'post',
    data
  })
}

// 获取资产详情
export function getAssetDetailApi(data: { id: number }) {
  return request({
    url: '/inStore/getAssetDetail',
    method: 'post',
    data
  })
}
